﻿using PhuLeBussinessObject.Product;
using PhuLeDao.Product;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace PhuLeBooze.UICode
{
    public class CProductTypeUI
    {
        public IList<CProductType> GetList()
        {
            CProductTypeDao productDao = new CProductTypeDao();
            IList<CProductType> list = productDao.GetProductType(string.Format("<InputValue RowsPerPage='50' PageIndex='1' sidx='' sord='asc' Context='AvailableProduct'/>", 0));
            return list;
        }
        public CProductType GetProductTypeDetail(string ID)
        {
            CProductTypeDao productDao = new CProductTypeDao();
            IList<CProductType> list = productDao.GetProductType(string.Format("<InputValue ID='{0}' Context='ByProductID'/>", ID));
            if (list != null)
                if (list.Count > 0)
                    return list[0];
            return null;
        }
    }
}